package com.hadoop.mapreduce.fullsort.partition;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.mapreduce.Partitioner;

/**
 * @author zouhuixing
 * @date 2023/11/24
 */
public class FullSortPartitioner extends Partitioner<IntWritable, IntWritable> {
    public int getPartition(IntWritable key, IntWritable value, int i) {
        if (key.get() > 30000) {
            return 0;
        } else if (key.get() > 20000) {
            return 1;
        } else if (key.get() > 10000) {
            return 2;
        } else {
            return 3;
        }
    }
}
